import { createRouter, createWebHistory } from "vue-router";
import Home from "@/views/Home.vue";

// 定义路径
const routes = [
  { path: "/", name: "Home", component: Home },
  // 惰性加载路径
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login.vue"),
  },
  {
    path: "/registered",
    name: "Registered",
    component: () => import("@/views/Registered.vue"),
  },
  // illust 详情
  {
    path: "/illust/:id",
    name: "illust.show",
    component: () => import("@/views/Illust.vue"),
  },
  // user
  {
    path: "/user/:id",
    name: "user.show",
    component: () => import("@/views/User.vue"),
  },
];
const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
